<?php

namespace App\Server\Model;
class Messages extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'messages';


    public function getValueByWhere($where,$field){
        return $this->where($where)->value($field);
    }



    public function dataSave($data,$where,$field=true,$updateType=true,$type='one'){
        if ($type=='one'){
            return $this->allowField($field)->isUpdate($updateType)->save($data,$where);
        }elseif ($type=='all'){
            return $this->saveAll($data);
        }
    }
}
